//
//  Feedback.m
//  Opper
//
//  Created by Le Dung on 4/19/13.
//  Copyright (c) 2013 LeDung. All rights reserved.
//

#import "Feedback.h"
#import <Twitter/Twitter.h>
@interface Feedback ()

@end

@implementation Feedback

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

-(void)viewDidAppear:(BOOL)animated
{
    [StyleClass barButtonItemEdit:self left:YES right:NO];
}
-(void)leftPress
{
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)sharePress
{
    MainScreen *page =[[[MainScreen alloc]init]autorelease];
    
    
    
    [StyleClass currentScreen:self andDestination:page andHideBackButton:YES];
}

-(void)buttonTarget
{
    [self.shareButton addTarget:self action:@selector(sharePress) forControlEvents:UIControlEventTouchUpInside];
    [self.shareButton setBackgroundImage:[StyleClass nGreen] forState:UIControlStateNormal];
    [self.twitterButton setBackgroundImage:[UIImage imageNamed:@"TwShare"] forState:UIControlStateNormal];
    [self.twitterButton addTarget:self action:@selector(twitterPress) forControlEvents:UIControlEventTouchUpInside];
    
    [self.faceButton  setBackgroundImage:[UIImage imageNamed:@"FaceShare.png"] forState:UIControlStateNormal];
    [self.faceButton addTarget:self action:@selector(facePress) forControlEvents:UIControlEventTouchUpInside];
    
}

-(void)twitterPress
{
    
    TWTweetComposeViewController *tweetSheet = [[[TWTweetComposeViewController alloc] init] autorelease];
    [tweetSheet setInitialText:@"My Opper is coming for you"];
    
    [self presentViewController:tweetSheet animated:NO completion:nil];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self buttonTarget];
    [StyleClass createNavi:self andTitle:@"Uw brief is verstuurd"];
    [StyleClass background:self.view];
    [self styleContaint];
}


-(void)styleContaint
{
    [self.containView setBackgroundColor:[UIColor whiteColor]];
    self.containView.layer.shadowColor = [[UIColor blackColor] CGColor];
    self.containView.layer.shadowOffset = CGSizeMake(0, 1);
    self.containView.layer.shadowOpacity = 0.7f;    
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc {
    [_containView release];
    [_faceButton release];
    [_twitterButton release];
    [_userTextView release];
    [_shareButton release];
    [super dealloc];
}
@end
